<%@ page contentType="text/html;charset=UTF-8" language="java" 
import="java.util.ArrayList,
com.scalar.chiptrack.operations.process.VendorLocation,
com.scalar.chiptrack.operations.process.SortProcess,
com.scalar.chiptrack.operations.process.forms.SortProcessForm,
com.scalar.chiptrack.utils.ConfigManager"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<chiptrack:checkLogon sourcePage="/sortProcess.do"/>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href='<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css' type='text/css' rel='stylesheet'>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/sort_process.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script language="javaScript">
    function back(){
       window.location = '<%=chipTracContext%>/processView.do?action=true&productID='+document.sortProcessForm["sortProcess.baseProductId"].value;
    }
</script>
</HEAD>
<BODY bgColor='#ffffff' leftMargin='0' topMargin='0' marginheight='0' marginwidth='0' onLoad='javascript:whileLoad();'>
<%
  java.util.ArrayList list = new java.util.ArrayList();
  list.add(new org.apache.struts.util.LabelValueBean("As Needed", "asneeded"));
  list.add(new org.apache.struts.util.LabelValueBean("Weekly", "weekly"));
  list.add(new org.apache.struts.util.LabelValueBean("Monthly", "monthly"));
  list.add(new org.apache.struts.util.LabelValueBean("Quarterly", "quarterly"));
  pageContext.setAttribute("poFrequencies", list);
%>
<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->

<%@ include file="/jsp/operations/operations_menu.jsp"%>

	</TD>
<!-- end of the side navigations -->

<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>
<!-- from here your body starts -->

<html:form name="sortProcessForm" method="post" action="/sortProcess.do" type="com.scalar.chiptrack.operations.process.forms.SortProcessForm" enctype="multipart/form-data">
 <nested:nest property="sortProcess" >
        <!-- added by hareesh on 18th Septemeber 2003 -->
       <nested:hidden  property="baseProductId" />

       <!-- added by hareesh on 2nd October 2003 -->
       <nested:hidden  property="processType" />

       <!-- added by hareesh on 6th October 2003 -->
       <nested:hidden property="trackId"/>

<center><span class="NArialW">Sort</span></center>&nbsp;
<table border='0' width='90%' align='right'>
<tr><td>
<chiptrack:errors styleClass="NArialL"/>
</td></tr>
<tr><td align="left">
<strong><font class="NArialL"><font color="FF0000"><font id="message"></font></font></font>
<table border="0" width="100%" align=right>
  <tr>
    <td width="21%"><font class="NArialL">Sort Part Number:</font></td>
    <td width="28%" align="left">
          <nested:text property="sortProductName" size="17" styleClass="txfield" /><a href="javascript:addDupPartNumber('sortProcess.dupProductName','Sort Part Number');" title='Click here to add duplicate Product Name'><img border=0 src='<%=chipTracContext%>/jsp/includes/images/add.jpg' height='15' width='20' align=center></a>
    </td>
    <td width="5%">&nbsp;</td>
    <td width="18%"><font class="NArialL">Expected Net Die/Wafer:</font></td>
    <td width="37%" align="left">
	<nested:text property="expectedNetDiePerWafer" size="17" styleClass="txfield" /></td>
  </tr>
  <logic:present name="sortProcess" property="dupProductName">
  <logic:iterate name="sortProcess" property="dupProductName" id="xxxx">
		<tr>
	 		<td width="21%"><font class="NArialL"><font color=green>Sort Part Number:</font></font></td>
			<td width="28%" align="left">
				<input type="text" name="sortProcess.dupProductName" value="<%=xxxx%>" class=txfield size="17" maxlength="50" />
			</td>
		</tr>
  </logic:iterate>
  </logic:present>
  <tr>
	<td colspan='5'><font id="font1"></font></td>
  </tr>
  <tr>
    <td width="21%"><font class="NArialL">Lot Hold Yield Limit:</font></td>
    <td width="28%" align="left">
  <nested:text property="lotHoldYieldLimit" size="17" styleClass="txfield" />
    </td>
    <td width="5%">&nbsp;</td>

    <td width="18%"><font class="NArialL">Lot Scrap Yield Limit:</font></td>
    <td width="37%" align="left">
	<nested:text property="lotScrapYieldLimit" size="17" styleClass="txfield" /></td>
  </tr>
  <tr>
    <td width="21%"><font class="NArialL">Standard Unit Cost:</font></td>
    <td width="28%" align="left">
	<nested:text property="stndUnitCost" size="17" styleClass="txfield" /></td>
    <td width="5%">&nbsp;</td>
    <td width="18%"><font class="NArialL">PO Frequency:</font></td>
    <td width="37%" align="left">
		<nested:select property="poFrequency" styleClass="txfield">
            <html:option value="0">Select</html:option>
            <html:options collection="poFrequencies" property="value" labelProperty="label"/>
    	</nested:select>
    </td>
  </tr>
  <tr>

    <td width="21%"><font class="NArialL">Procedure Doc. No:</font></td>
    <td width="28%" align="left"><font class="NArialL">
    	<nested:text property="procedureDocNo" size="17" styleClass="txfield" /></font>
    </td>
    <td width="5%">&nbsp;</td>
    <td width="18%"><font class="NArialL">Program Doc. No:</font></td>
    <td width="37%" align="left"><font class="NArialL">
    	<nested:text property="programDocNo" size="17" styleClass="txfield" /></font></td>
  </tr>
  <tr>
    <td width="21%"><font class="NArialL">Procedure Doc File:</font></td>
    <td width="28%" align="left">
         <html:file name="sortProcessForm" property="procedureDocFile"  size="9" styleClass="txfield" />
    </td>

    <td width="5%">&nbsp;</td>
    <td width="18%"><font class="NArialL">Program Doc File:</font></td>
    <td width="37%" align="left">

        <html:file name="sortProcessForm" property="programDocFile" size="9" styleClass="txfield" />
   </td>
  </tr>
  <tr>
    <td width="21%"><font class="NArialL">Probe Card No:</font></td>
    <td width="28%" align="left"><font class="NArialL">

    	<nested:text property="probeCardNo" size="17" styleClass="txfield" /></font></td>

    <td width="5%">&nbsp;</td>
    <td width="18%"><font class="NArialL">System:</font></td>
    <td width="37%" align="left"><font class="NArialL">
    	<nested:text property="system"  size="17" styleClass="txfield" /></font></td>
  </tr>
  <tr>

    <td width="21%"><font class="NArialL">RMA Criteria:</font></td>
    <td width="28%" align="left"><font class="NArialL">
    	<nested:text property="rmaCriteria" size="17" styleClass="txfield" /></font></td>

    <td width="5%">&nbsp;</td>
    <td width="18%"><font class="NArialL">Scrap Criteria: </font></td>
    <td width="37%" align="left"><font class="NArialL">
    	<nested:text property="scrapCriteria" size="17" styleClass="txfield" /></font></td>
  </tr>
  <tr><td colspan=5>&nbsp</td></tr>

  <tr><td colspan=5 class="NArialL">Comments:</td></tr>
  <tr><td colspan=5 class="NArialL">
  <nested:textarea property="comments" rows="4" name="S1" cols="94" styleClass="txfield" /></textarea></td></tr>
</table>
</nested:nest> 
</td></tr>
<tr><td>
<table border="0" width="98%" bordercolor="#FFFFFF">
    <tr>
      <td colspan=10 class="NArialL">Vendor Location Information:</td></tr>
    <tr>
      <td width="5%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Select</font></font></td>
      <td width="5%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Priority</font></font></td>
      <td width="20%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Location</font></font></td>
      <td width="5%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">% Split</font></font></td>
      <td width="5%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Capacity/Week</font></font></td>
      <td width="10%" align="center" bgcolor="#993333" colspan="2">
      	<font class="NArialL"><font color="#FFFFFF">Cost/Unit<BR>
        Normal&nbsp;&nbsp; Express</font></font>
      </td>
      <td width="10%" align="center" bgcolor="#993333" colspan="2">
	  <font class="NArialL"><font color="#FFFFFF">Cycle Time<BR>
        Normal&nbsp;&nbsp; Express</font></font>
       </td>
       <td width="5%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Laser
  		Repair Allowed</font></td>
       <td width="10%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Laser
        Cost/Unit</font></font></td>
     </tr>

	 <%
	 SortProcessForm sortProcessForm = (SortProcessForm)request.getAttribute("sortProcessForm"); 
	 SortProcess sortProcess = (SortProcess)sortProcessForm.getSortProcess();
	 ArrayList vendorLocations = (ArrayList) sortProcess.getVendorLocations();
     if (vendorLocations == null) vendorLocations = new ArrayList();
     int size = vendorLocations.size();
	 //System.out.println("size "+size);
     VendorLocation location = null;
     for (int i=0; i<size; i++) {
     location = (VendorLocation) vendorLocations.get(i);%>


      <tr>
      <td width="5%" align="center" bgcolor="#DEE1E2"><font class="NArialL">
	  <input type="checkbox" name="<%="select_"+i%>" <%if((location.getSelect() != null) && (location.getSelect().trim().length() != 0)) out.print ("checked");%>  class="txfield" onclick="checkLocation(<%=i%>,'select_')" value="off"/></font></td>
      <td width="5%" align="center" bgcolor="#DEE1E2"><font class="NArialL">
	  <input type=text name="priority" size="6" disabled="true" value='<%if (location.getPriority() != null) out.print (location.getPriority());%>' class="txfield" /></font></td>
      <td width="20%" align="center" bgcolor="#DEE1E2"><font class="NArialL">
	  <input type="text" name="locationName" value='<%=location.getLocationName()%>' disabled="true" size="18" class="txfield" />
      <input type="hidden" name="locationID" value='<%=location.getLocationID()%>' size="18" class="txfield" /></font></td>
      <td width="5%" align="center" bgcolor="#DEE1E2"><font class="NArialL">
	  <input type=text name="split" size="7" disabled="true" value='<%if (location.getSplit() != null) out.print (location.getSplit());%>' class="txfield" /></font></td>
      <td width="5%" align="center" bgcolor="#DEE1E2"><font class="NArialL">
	  <input type=text name="capacityWeek" size="14" disabled="true" 
	  value='<%if (location.getCapacityWeek() != null) out.print (location.getCapacityWeek());%>' class="txfield" /></font></td>
      <td width="5%" align="center" bgcolor="#DEE1E2"><font class="NArialL">
	  <input type=text name="normalCost" size="6" disabled="true" value='<%=location.getNormalCost()%>' class="txfield" /></font></td>
      <td width="5%" align="center" bgcolor="#DEE1E2"><font class="NArialL">
	  <input type=text name="expressCost" size="6" disabled="true" value='<%=location.getExpressCost()%>' class="txfield" /></font></td>
      <td width="5%" align="center" bgcolor="#DEE1E2"><font class="NArialL">
	  <input type=text name="normalCycleTime" size="6" disabled="true" value='<%if (location.getNormalCycleTime() != null) out.print (location.getNormalCycleTime());%>' class="txfield" /></font></td>
       <td width="5%" align="center" bgcolor="#DEE1E2"><font class="NArialL">
	  <input type=text name="expressCycleTime" size="6" disabled="true" value='<%if (location.getExpressCycleTime() != null) out.print (location.getExpressCycleTime());%>' class="txfield" /></font></td>
      <td width="5%" align="center" bgcolor= "#DEE1E2"><font class="NArialL">
	  <input type=checkbox name="<%="laserRepairAllowed_"+i%>" onclick="checkLaser(<%=i%>,'laserRepairAllowed_')" size="6" disabled="true" <%if(location.getLaserRepairAllowed() == true) out.print ("checked");%> class="txfield" /></font>
      </td>
      <td width="10%" align="center" bgcolor="#DEE1E2">
	  <font class="NArialL">
	  <input type=text name="laserRepairCost" size="6" disabled="true" value='<%=location.getLaserRepairCost()%>' class="txfield" />
	    </font>
      </td>
    </tr>
	<%}%>
  </table>
  <input type="hidden" name="count" value="<%=size%>" >
</td></tr>
<tr><td>
<table border="0" width="98%" bordercolor="#FFFFFF">
    <tr><td colspan=6>&nbsp;</td></tr>
    <tr>
	<td align=center colspan=6>
	<!-- here you need to check the process flow, if there is no die bank then need to point next button to test page -->
    <!-- changed by hareesh on 16th Septemeber 2003 -->
	  <!--a href="javascript:saveProcess(document.sortProcessForm,'binsetup');"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/binsetup.gif" /></a-->
       <chiptrack:restrictedLink functionality='<%=Functionality.PRODUCT_SETUP%>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:back();' onmouseover="window.status='Click here to go back to Process View';return true" onmouseout="window.status='';return true">
       <img border='0' src='<%=chipTracContext%>/jsp/includes/images/back.gif'></chiptrack:restrictedLink></a>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <!--a href="javascript:saveProcess(document.sortProcessForm,'save');"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" /></a-->
         <chiptrack:restrictedLink functionality='<%=Functionality.PRODUCT_SETUP%>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:saveProcess(document.sortProcessForm,\'save\');' onmouseover="window.status='Click here to save this SORT Process';return true" onmouseout="window.status='';return true">
         <img border='0' src='<%=chipTracContext%>/jsp/includes/images/save.gif'></chiptrack:restrictedLink>
	    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 <!--a href="#"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17"></a-->
   </td></tr>

</table></td></tr>
</table>
<input type="hidden" name="action" value="">
</html:form>

<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->

<%@ include file="/jsp/includes/footer.jsp" %>

<!-- footer end here -->

</BODY>
</HTML>
